<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- <button id="btn" onclick="function(){console.log('hello');say();}">button</button> -->
    <button id="btn" onclick="console.log('hello');say();">button</button>
    <script>
      /*
      onclick 后面必须要是函数代码
      */
      function say() {
        console.log("hi");
      }
    </script>
  </body>
</html>
